/*    REPLICATION NOTES  

*This do-file contains the syntax for all data sets used in the paper. Please be sure to load the according data set when replicating results.

Date:        		12 January 2021
Code Version:		Submission Version
Author:      		Tuxhorn, D'Attoma, and Steinmo
Purpose:     		These files reproduce all results reported in tables and figures found in
					"Assessing the Stability of Fiscal Attitudes: Evidence from a Survey Experiment" and the supplementary material 
Data Used:   		Mturk Survey Data on Budget Preferences
File Names:   		"Replication Do File" (file that estimates the models reported in paper)
Input Files:		"Submission_dataset.dta"   
Machine:     		MGF; Macbook
Version:			Stata 14.2
*/

******************************************************************
*************Using Submission data set*******************
******************************************************************

*clear
set more off
*use "Submission_dataset.dta", clear



************************************************************************************
*************Replication of Tables and Figures found in Main Text*******************
************************************************************************************


********************Descriptives********************

*TABLE 5. Descriptive Statistics  

summ spending_total_bil revenue_total_bil female white income  education  age1 age2 age3 age4 democrat liberal

********************SPENDING SIDE********************

*TABLE 6. Spending Total Model  

qui reg  spending_total_bil spending_treatment    
 eststo m11 
qui reg   spending_total_bil spending_treatment female income   white   liberal  education  age2 age3 age4 
 eststo m12
qui reg   spending_total_bil spending_treatment female income   white      education  age2 age3 age4 democrat
 eststo m13
qui reg   spending_total_bil spending_treatment female income   white    liberal  education  age2 age3 age4 democrat 
 eststo m14
estout m1*, label style(fixed) cells(b(star fmt(%9.3f))se(par)) starlevels(+ 0.10 * 0.05 ** 0.01) stats( N r2, labels( "N" " R2"   ))  varlabels(spending_treatment "Spending Treatment" female "Female" income "Income" white "White" liberal "Liberal" education "Education Level" age2 "Age (30-44)" age3 "Age (45-64)" age4 "Age (65 and Over)" democrat "Democrat") varwidth(25)
  eststo clear
  
********************REVENUE SIDE********************

*TABLE 7. Revenue Total Model  

qui reg  revenue_total_bil revenue_treatment 
  eststo m21
qui reg  revenue_total_bil revenue_treatment  female income   white   liberal  education  age2 age3 age4 
  eststo m22
qui reg  revenue_total_bil revenue_treatment  female income   white      education  age2 age3 age4 democrat
  eststo m23
qui reg  revenue_total_bil revenue_treatment  female income   white   liberal   education  age2 age3 age4 democrat
  eststo m24 
estout m2*, label style(fixed) cells(b(star fmt(%9.3f))se(par)) starlevels(+ 0.10 * 0.05 ** 0.01) stats( N r2, labels( "N" " R2"   ))  varlabels(revenue_treatment "Revenue Treatment" female "Female" income "Income" white "White" liberal "Liberal" education "Education Level" age2 "Age (30-44)" age3 "Age (45-64)" age4 "Age (65 and Over)" democrat "Democrat") varwidth(25)
  eststo clear
  
********************ROBUSTNESS CHECK: MODELING INDIVIDUAL BUDGET ITEMS********************

*TABLE 8. Individual Spending Line Items: t-test Results Comparing Spending Treatment and Combined Treatment 
foreach x in pc2_tax_below_25800 pc2_tax_25k_50k pc2_tax_50k_88k pc2_tax_88k_151k pc2_tax_151k_741k pc2_tax_over_741K pc2_payroll_tax pc2_corporate_tax pc2_estate_tax pc2_gas_tax pc2_other_taxes{
 ttest `x', by(revenue_treatment)  
}

*TABLE 9. Individual Revenue Line Items: t-test Results Comparing Revenue Treatment and Combined Treatment 

foreach x in pc2_morgage_deduction pc2_military_spend pc2_medicare_spending pc2_medicaid_spending pc2_legal_spending pc2_k12_spending pc2_job_training pc2_infrastructure pc2_humanitarian_aid pc2_housing_assistance pc2_higher_ed_spending pc2_health_exempt pc2_for_military_aid pc2_fed_pensions pc2_farm_spending pc2_fam_nutrition_spending pc2_disability_spending pc2_diplomatic_spending pc2_community_spending pc2_border_spending pc2_arts_spending pc2_aca pc2_water_air_spending pc2_veterans_spending pc2_unemployment_spending pc2_retirement_benefits pc2_research_spending{
 ttest `x', by(spending_treatment)  
}




************************************************************************************
*************Replication of Tables and Figures found in APPENDIX********************
************************************************************************************


*********************Balance of Covariates by treatment group*********************
 
*NOTE: Must install orth_out package. See oe Long, 2014. "ORTH_OUT: Stata module to automate and export summary stats/orthogonality tables," Statistical Software Components S457800, Boston College Department of Economics, revised 05 Feb 2016. 

*ssc install orth_out

*TABLE 10. Covariate Balance Test

orth_out female white income  education  age1 age2 age3 age4 democrat liberal, by(treatment3)  se  test count 


********************ROBUSTNESS CHECK: MODELING INDIVIDUAL BUDGET ITEMS********************
*TABLE 11. Budget Line Item Models: Revenue - Income Tax Brackets

foreach x in    pc2_tax_below_25800  pc2_tax_25k_50k     pc2_tax_50k_88k   pc2_tax_88k_151k   pc2_tax_151k_741k pc2_tax_over_741K {
 qui reg `x' revenue_treatment  female income   white   liberal   education  age2 age3 age4 democrat 
  eststo m_`x'
 estout m*, label style(fixed) cells(b(star fmt(%9.3f))se(par)) starlevels(+ 0.10 * 0.05 ** 0.01) stats( N r2, labels( "N" " R2"   ))  varlabels(revenue_treatment "Revenue Treatment" female "Female" income "Income" white "White" liberal "Liberal" education "Education Level" age2 "Age (30-44)" age3 "Age (45-64)" age4 "Age (65 and Over)" democrat "Democrat") varwidth(25)
  eststo clear
}


*TABLE 12. Budget Line Item Models: Revenue - Non-Income Tax Items


foreach x in    pc2_payroll_tax         pc2_estate_tax   pc2_corporate_tax  pc2_gas_tax pc2_other_taxes{
 qui reg `x' revenue_treatment  female income   white   liberal   education  age2 age3 age4 democrat 
  eststo m_`x'
 estout m*, label style(fixed) cells(b(star fmt(%9.3f))se(par)) starlevels(+ 0.10 * 0.05 ** 0.01) stats( N r2, labels( "N" " R2"   ))  varlabels(revenue_treatment "Revenue Treatment" female "Female" income "Income" white "White" liberal "Liberal" education "Education Level" age2 "Age (30-44)" age3 "Age (45-64)" age4 "Age (65 and Over)" democrat "Democrat") varwidth(25)
  eststo clear
}

*TABLE 13. Budget Line Item Models: Spending Items (1 of 4 pages)


foreach x in pc2_morgage_deduction pc2_military_spend pc2_medicare_spending pc2_medicaid_spending pc2_legal_spending pc2_k12_spending pc2_job_training {
 qui reg `x' spending_treatment  female income   white   liberal   education  age2 age3 age4 democrat 
   eststo m`x'
 estout m*, label style(fixed) cells(b(star fmt(%9.3f))se(par)) starlevels(+ 0.10 * 0.05 ** 0.01) stats( N r2, labels( "N" " R2"   ))  varlabels(revenue_treatment "Revenue Treatment" female "Female" income "Income" white "White" liberal "Liberal" education "Education Level" age2 "Age (30-44)" age3 "Age (45-64)" age4 "Age (65 and Over)" democrat "Democrat") varwidth(25)
  eststo clear
}

*TABLE 14. Budget Line Item Models: Spending Items (2 of 4 pages)
  

foreach x in  pc2_infrastructure pc2_humanitarian_aid pc2_housing_assistance pc2_higher_ed_spending pc2_health_exempt pc2_for_military_aid pc2_fed_pensions {
 qui reg `x' spending_treatment  female income   white   liberal   education  age2 age3 age4 democrat 
   eststo m`x'
 estout m*, label style(fixed) cells(b(star fmt(%9.3f))se(par)) starlevels(+ 0.10 * 0.05 ** 0.01) stats( N r2, labels( "N" " R2"   ))  varlabels(revenue_treatment "Revenue Treatment" female "Female" income "Income" white "White" liberal "Liberal" education "Education Level" age2 "Age (30-44)" age3 "Age (45-64)" age4 "Age (65 and Over)" democrat "Democrat") varwidth(25)
  eststo clear
}

  *TABLE 15. Budget Line Item Models: Spending Items (3 of 4 pages)

foreach x in pc2_farm_spending pc2_fam_nutrition_spending pc2_disability_spending pc2_diplomatic_spending pc2_community_spending pc2_border_spending {
 qui reg `x' spending_treatment  female income   white   liberal   education  age2 age3 age4 democrat 
   eststo m`x'
 estout m*, label style(fixed) cells(b(star fmt(%9.3f))se(par)) starlevels(+ 0.10 * 0.05 ** 0.01) stats( N r2, labels( "N" " R2"   ))  varlabels(revenue_treatment "Revenue Treatment" female "Female" income "Income" white "White" liberal "Liberal" education "Education Level" age2 "Age (30-44)" age3 "Age (45-64)" age4 "Age (65 and Over)" democrat "Democrat") varwidth(25)
  eststo clear
}

 
  *TABLE 16. Budget Line Item Models: Spending Items (4 of 4 pages)

foreach x in pc2_arts_spending pc2_aca pc2_water_air_spending pc2_veterans_spending pc2_unemployment_spending pc2_retirement_benefits pc2_research_spending {
 qui reg `x' spending_treatment  female income   white   liberal   education  age2 age3 age4 democrat 
   eststo m`x'
 estout m*, label style(fixed) cells(b(star fmt(%9.3f))se(par)) starlevels(+ 0.10 * 0.05 ** 0.01) stats( N r2, labels( "N" " R2"   ))  varlabels(revenue_treatment "Revenue Treatment" female "Female" income "Income" white "White" liberal "Liberal" education "Education Level" age2 "Age (30-44)" age3 "Age (45-64)" age4 "Age (65 and Over)" democrat "Democrat") varwidth(25)
  eststo clear
}
  
  

 
